package com.savi.myapplication.model;

import com.google.gson.annotations.Expose;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

/**
 * 卡片信息类
 */
public class FlyCardInfo {

    /**
     * 卡片的UUID
     */
    private String cardUUid;
    /**
     * 卡片的名称
     */
    private String strCardName = "";
    /**
     * 记录的类型 1：飞行时间记录表 2：训练、任务飞行时间记录表，
     */
    private Integer recordType = 1;

    //基本信息的数量
    private List<Integer> numberList = new ArrayList<>();
    //训练、任务
    private List<Integer> numberListTrain = new ArrayList<>();

    /**
     * 年
     */
    private String year = "";
    /**
     * 月
     */
    private String month = "";
    /**
     * 日
     */
    private String day = "";

    //性质：训练、任务、试飞
    private String train = "";

    private String task = "";

    private String testFly = "";

    //任务性质:训练、任务、试飞   转训、任务
    private String taskProperty = "";
    //训练任务的性质：转训、任务
    private String taskPropertyTrain = "";
    //任务等级 A B C D
    private String taskLevel = "";

    /**
     * 机型
     */
    private String planeType = "";
    private String planeTypeID = "";
    /**
     * 飞机号
     */
    private String planeNum = "";
    /**
     * 总时间
     */
    private String totalTime = "";
    /**
     * 卡片的创建时间
     */
    private String createTime = "";
    //机长签字
    private String pilotSigned = "";
    //领导签字
    private String leaderSigned = "";
    //机长签字
    @Expose(serialize = false,deserialize = false)
    private byte[] pilotSignedByte;
    //领导签字
    @Expose(serialize = false,deserialize = false)
    private byte[] leaderSignedByte;
    //是否签名 0 没签  1签了
    private String signed = "";


    /**
     * 备用字段1
     */
    private String backUp1 = "";
    //是否签过名
    private boolean isSign=false;

    public boolean isSign() {
        return isSign;
    }

    public void setSign(boolean sign) {
        isSign = sign;
    }

    /**
     * 卡片对应的模板信息
     */
    private FlyCardTemplate flyCardTemplate;


    public void initTemplateInfo() {
        this.flyCardTemplate = new FlyCardTemplate();
        List<FlyCardBaseInfo> flyCardBaseInfoList = new ArrayList<>();
        List<FlyCardPeople> flyCardPeopleList = new ArrayList<>();
        List<FlyCardTrainInfo> flyCardTrainInfoList = new ArrayList<>();

        flyCardBaseInfoList.add(new FlyCardBaseInfo());
//        flyCardBaseInfoList.add(new FlyCardBaseInfo());

        //回填年月日信息
        Calendar calendar = Calendar.getInstance();
        int year = calendar.get(Calendar.YEAR);
        int month = calendar.get(Calendar.MONTH) + 1;
        int day = calendar.get(Calendar.DAY_OF_MONTH);
        int week = calendar.get(Calendar.DAY_OF_WEEK);

        FlyCardTrainInfo flyCardTrainInfo = new FlyCardTrainInfo();
        FlyCardTrainInfo flyCardTrainInfo1 = new FlyCardTrainInfo();
        if (month+1<10){
            flyCardTrainInfo.setDateTime(year + ".0" + month + "." + day);
            flyCardTrainInfo1.setDateTime(year + ".0" + month + "." + day);
        }else {
            flyCardTrainInfo.setDateTime(year + "." + month + "." + day);
            flyCardTrainInfo1.setDateTime(year + "." + month + "." + day);
        }

        flyCardTrainInfoList.add(flyCardTrainInfo);
//        flyCardTrainInfoList.add(flyCardTrainInfo1);

        flyCardTemplate.setFlyCardBaseInfoList(flyCardBaseInfoList);
        flyCardTemplate.setFlyCardPeopleList(flyCardPeopleList);
        flyCardTemplate.setFlyCardTrainInfoList(flyCardTrainInfoList);

    }


    public byte[] getPilotSignedByte() {
        return pilotSignedByte;
    }

    public void setPilotSignedByte(byte[] pilotSignedByte) {
        this.pilotSignedByte = pilotSignedByte;
    }

    public byte[] getLeaderSignedByte() {
        return leaderSignedByte;
    }

    public void setLeaderSignedByte(byte[] leaderSignedByte) {
        this.leaderSignedByte = leaderSignedByte;
    }

    public String getSigned() {
        return signed;
    }

    public void setSigned(String signed) {
        this.signed = signed;
    }

    public String getPilotSigned() {
        return pilotSigned;
    }

    public void setPilotSigned(String pilotSigned) {
        this.pilotSigned = pilotSigned;
    }

    public String getLeaderSigned() {
        return leaderSigned;
    }

    public void setLeaderSigned(String leaderSigned) {
        this.leaderSigned = leaderSigned;
    }

    public String getTaskPropertyTrain() {
        return taskPropertyTrain;
    }

    public void setTaskPropertyTrain(String taskPropertyTrain) {
        this.taskPropertyTrain = taskPropertyTrain;
    }

    public String getPlaneTypeID() {
        return planeTypeID;
    }

    public void setPlaneTypeID(String planeTypeID) {
        this.planeTypeID = planeTypeID;
    }

    public Integer getRecordType() {
        return recordType;
    }

    public void setRecordType(Integer recordType) {
        this.recordType = recordType;
    }

    public String getTaskProperty() {
        return taskProperty;
    }

    public void setTaskProperty(String taskProperty) {
        this.taskProperty = taskProperty;
    }

    public String getTaskLevel() {
        return taskLevel;
    }

    public void setTaskLevel(String taskLevel) {
        this.taskLevel = taskLevel;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getBackUp1() {
        return backUp1;
    }

    public void setBackUp1(String backUp1) {
        this.backUp1 = backUp1;
    }

    public List<Integer> getNumberList() {
        return numberList;
    }

    public void setNumberList(List<Integer> numberList) {
        this.numberList = numberList;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getMonth() {
        return month;
    }

    public void setMonth(String month) {
        this.month = month;
    }

    public String getDay() {
        return day;
    }

    public void setDay(String day) {
        this.day = day;
    }

    public String getTrain() {
        return train;
    }

    public void setTrain(String train) {
        this.train = train;
    }

    public String getTask() {
        return task;
    }

    public void setTask(String task) {
        this.task = task;
    }

    public String getTestFly() {
        return testFly;
    }

    public void setTestFly(String testFly) {
        this.testFly = testFly;
    }

    public String getPlaneType() {
        return planeType;
    }

    public void setPlaneType(String planeType) {
        this.planeType = planeType;
    }

    public String getPlaneNum() {
        return planeNum;
    }

    public void setPlaneNum(String planeNum) {
        this.planeNum = planeNum;
    }

    public String getTotalTime() {
        return totalTime;
    }

    public void setTotalTime(String totalTime) {
        this.totalTime = totalTime;
    }

    public String getCardUUid() {
        return cardUUid;
    }

    public void setCardUUid(String cardUUid) {
        this.cardUUid = cardUUid;
    }

    public String getStrCardName() {
        return strCardName;
    }

    public void setStrCardName(String strCardName) {
        this.strCardName = strCardName;
    }

    public FlyCardTemplate getFlyCardTemplate() {
        return flyCardTemplate;
    }

    public void setFlyCardTemplate(FlyCardTemplate flyCardTemplate) {
        this.flyCardTemplate = flyCardTemplate;
    }

    public List<Integer> getNumberListTrain() {
        return numberListTrain;
    }

    public void setNumberListTrain(List<Integer> numberListTrain) {
        this.numberListTrain = numberListTrain;
    }
}
